#include "stdio.h"

int main(int argc, char const *argv[]) {
  int begin, end, sum;
  scanf("%d %d", &begin, &end);
  for (int i = begin; i < end; i++) {
    sum = 0;
    for (int j = 1; j < i; j++) {
      if (i % j == 0) {
        sum += j;
      }
    }
    if (sum == i) {
      printf("%d\n", i);
    }
  }
  return 0;
}
